package com.example.demo.service.impl;

import com.example.demo.entity.AnIndexImg;
import com.example.demo.mapper.AnIndexImgMapper;
import com.example.demo.service.IAnIndexImgService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 首页轮播图的表 服务实现类
 * </p>
 *
 * @author Mr.we
 * @since 2024-06-03
 */
@Service
public class AnIndexImgServiceImpl extends ServiceImpl<AnIndexImgMapper, AnIndexImg> implements IAnIndexImgService {
    @Autowired
    private AnIndexImgMapper indexImgMapper;

    @Override
    public void deleteIndexImgByIds(Long[] ids) {
        indexImgMapper.deleteIndexImgByIds(ids);
    }

    @Override
    @Cacheable(cacheNames = "indexImg", key = "'indexImg'")
    public List<AnIndexImg> listIndexImg() {
        return indexImgMapper.listIndexImg();
    }

    @Override
    @Cacheable(cacheNames = "indexImg", key = "'indexImg'")
    public void removeIndexImgCache() {

    }
}
